/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test_cv;

/**
 *
 * @author acappon
 */
public class CTarget
{

    int m_value; // Relative importance -- a 5 point goal is better than a 3 point goal
    double m_range;
    double m_azimuth;
    double m_elevation;

    void init()
    {
        m_value = 0;
        m_range = -1.0; // Range = -1 indicates that this info has not be set to anything yet
        m_azimuth = 0.0;
        m_elevation = 0.0;
    }

    String displayText()
    {
        return "   Value:" + m_value + "  Range:" + m_range + "  Azimuth:" + m_azimuth + "  Elevation:" + m_elevation;
    }

    void parse(String result)
    {
        int delimiterIndex = result.indexOf(",");
        String strToken = result.substring(0, delimiterIndex);
        String remaining = result.substring(delimiterIndex);

        m_value = Integer.parseInt(strToken);

        delimiterIndex = result.indexOf(",");
        strToken = result.substring(0, delimiterIndex);
        remaining = result.substring(delimiterIndex);
        
        m_range = Double.parseDouble(strToken);
        
        delimiterIndex = result.indexOf(",");
        strToken = result.substring(0, delimiterIndex);
        remaining = result.substring(delimiterIndex);
        
        m_azimuth = Double.parseDouble(strToken);
        
        delimiterIndex = result.indexOf("\n");
        strToken = result.substring(0, delimiterIndex);
        remaining = result.substring(delimiterIndex);
        
        m_elevation = Double.parseDouble(strToken);
    }
}